/* 用户相关接口 */

const UserService = require('../../services/admin/UserService');

const UserController = {
	login: async (req, res) => {
		// req.body.username;
		// req.body.password;
		var result = await UserService.login(req.body);

		if (result.length === 0) {
			res.send({
				code: '-1',
				error: '用户名密码不匹配',
			});
		} else {
			res.send({
				token: 'OK',
			});
		}
	},
};

module.exports = UserController;
